<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.vo.MeetingRoomMain;"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	MeetingRoomMain room =(MeetingRoomMain)request.getAttribute("room");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<base href="<%=basePath%>" />
	<head>
		<title>天津市粮油集团有限公司</title>
		<style type="text/css">
td {
	font: 12px/ 170% "宋体", "新宋体", "黑体";
	color: #000
}

th {
	font: 12px/ 170% "宋体", "新宋体", "黑体";
	color: #000
}

.black_overlays {
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 1000px;
	height: 800px;
	background-color: gray;
	z-index: 1001;
	-moz-opacity: 0.8;
	opacity: .80;
	filter: alpha(opacity = 80);
}

/* 添加任务div样式 */
.ceshi5 {
	display: none;
	position: absolute;
	top: 25%;
	left: 35%;
	width: 355px;
	height: 235px;
	border: 16px solid #FFF;
	border-bottom: none;
	background-color: white;
	z-index: 1003;
	overflow: auto;
}
</style>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet"
			type="text/css" />
		
		<link href="<%=basePath %>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
	    <script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
	    <script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script> 

		<script type="text/javascript">
		function checkAllTextValid(form)  
		{  
		    //记录不含引号的文本框数量  
			var resultTag = 0;  
			//记录所有text文本框数量  
			var flag = 0;  
			for(var i = 0; i < form.elements.length; i ++)  
			{  
			 if(form.elements[i].type=="text")  
			 {  
			     flag = flag + 1;  
			  //此处填写所要过滤的特殊符号  
			  //注意：修改####处的字符，其它部分不许修改.  
			  //if(/^[^####]*$/.test(form.elements[i].value))  
			  if(/^[^\|"'<>]*$/.test(form.elements[i].value)) resultTag = resultTag+1;  
			  else form.elements[i].select();  
			 }  
			}
			//如果含引号的文本框等于全部文本框的值，则校验通过  
			if(resultTag == flag) return true;  
			else 
			{  
			 Ext.MessageBox.alert('提示框',"<nobr>文本框中不能含有<br/> 1 单引号: ' <br/> 2 双引号: \" <br/> 3 竖  杠: | <br/> 4 尖角号: < > <br/><br/>请检查输入！</nobr>");  
			 return false;  
			}  
		} 
	
		function submitform1(){
			var parten = /^\s*$/ ;
			var zhengze = /^[1-9][0-9]*$/;
			if(document.form1.roomName.value == null || document.form1.roomName.value == ''){
				Ext.MessageBox.alert('提示框','<nobr>请填入会议室名称</nobr>');
			}
			else if(parten.test(document.form1.roomName.value)){
			    Ext.MessageBox.alert('提示框','<nobr>会议室名称不能为空格</nobr>');
			}
			else if(document.form1.roomName.value.length>10){
			    Ext.MessageBox.alert('提示框','<nobr>会议室名称不能多于10个汉字</nobr>');
			}
			else if(document.form1.peopleNum.value == null || document.form1.peopleNum.value == ''){
			    Ext.MessageBox.alert('提示框','<nobr>请填入会议室容纳人数</nobr>');
			}
			else if(parten.test(document.form1.peopleNum.value)){
			    Ext.MessageBox.alert('提示框','<nobr>会议室容纳人数不能为空格</nobr>');
			}
			else if(isNaN(document.form1.peopleNum.value)){
				Ext.MessageBox.alert('提示框','<nobr>会议室容纳人数需为数字</nobr>');
			}
			else if(!zhengze.test(document.form1.peopleNum.value)){
				Ext.MessageBox.alert('提示框','<nobr>会议室容纳人数需为正整数</nobr>');
			}
			else if(document.form1.peopleNum.value.length>5){
			    Ext.MessageBox.alert('提示框','<nobr>会议室容纳人数不能多于5个汉字</nobr>');
			}
			else if(document.form1.orderNum.value == null || document.form1.orderNum.value == ''){
			    Ext.MessageBox.alert('提示框','<nobr>请填入会议室排序</nobr>');
			}
			else if(isNaN(document.form1.orderNum.value)){
				Ext.MessageBox.alert('提示框','<nobr>会议室排序需为数字</nobr>');
			}
			else if(parten.test(document.form1.remarks.value)){
			    document.getElementById('remarks').value = '';
			    document.form1.submit();
			}
			else if(document.form1.remarks.value.length>150){
			    Ext.MessageBox.alert('提示框','<nobr>备注不能多于150个汉字</nobr>');
			}
			else{
				if(checkAllTextValid(document.form1))document.form1.submit();
			}
		}
		function back()
		{
			history.back(-1);
		}
		window.onload = function(){
			document.getElementById("right").style.height = document.body.clientHeight;
			document.getElementById("tableid").style.height = document.body.clientHeight-60;
			var tb = new Ext.Toolbar(
				{
					height:25
				}
			);
		
		    tb.render('menu');
			tb.add(
		    {
		            text:'确定',
		            iconCls: 'daohang',
		        	handler: function(){
		        		submitform1();
					}
		    },
		    {
		            text:'返回',
		            iconCls: 'daohang',
		        	handler: function(){
		        		window.location.href = "<%=basePath %>tjsinfo/tjsoa/meetingroom/meetingRoomList.do";
					}
		    }
		    );
			tb.addFill();
		    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;">修改会议室信息</a>&nbsp;&nbsp;&nbsp;');
		}
	</script>
	</head>
	<body>
	<form action="<%=basePath%>tjsinfo/tjsoa/meetingroom/againUpdate.do" method="post" name="form1">
		<input type="hidden" name="roomId" id="roomId" value="<%=room.getId() %>"/>
		<input name="place" id="place" type="hidden" value=""/>
		<div id="right">
		<div id="menu" style="padding-top:4px;"></div>
			<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tableid">
				<tr>
					<td valign="top" height="100%">
						<div class="contabwd">
							<table width="100%" style="height: 400px" border="0" cellspacing="0"
								cellpadding="0">
								<tr>
									<td width="70%" align="center">
										<table width="399" border="0" cellspacing="0" cellpadding="0"
											align="center" style="margin-top: 20px">
											<tr>
												<td>
													<img src="images/xghysxx.gif" />
												</td>
											</tr>
											<tr>
												<td>
													<div class="lwxx">
														<table width="371" border="0" align="center"
															cellpadding="0" cellspacing="0" class="ttaa">
															<tr>
																<td width="120" align="right">
																	<img src="images/dfdf_03.gif" />
																	&nbsp;会议室名称:
																</td>
																<td width="250">
																	<input name="roomName" type="text" size="44"
																		style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" value="<%=room.getMeetingroomName() %>" />
																</td>
																<td width="21">
																	&nbsp;
																</td>
															</tr>
															<tr>
																<td align="right">
																	<img src="images/dfdf_03.gif" />
																	&nbsp;排序:
																</td>
																<td>
																	<input name="orderNum" id="orderNum" value="<%=room.getOrderNum() %>" type="text" size="44" style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
																</td>
																<td>
																	&nbsp;
																</td>
															</tr>
															<tr>
																<td align="right">
																	<img src="images/dfdf_03.gif" />
																	&nbsp;容纳人数:
																</td>
																<td>
																	<input name="peopleNum" type="text" size="44"
																		style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" value="<%=room.getPeopleNumbert() %>"/>
																</td>
																<td>
																	&nbsp;
																</td>
															</tr>
															<tr>
																<td align="right">
																	<img src="images/dfdf_03.gif" />
																	&nbsp;备注:
																</td>
																<td>
																	<textarea id="remarks" name="remarks" cols="33" rows="5" value=""><%=room.getRemarks() %></textarea>
																</td>
																<td>
																	&nbsp;
																</td>
															</tr>
															<tr>
																<th colspan="3">
																	&nbsp;
																</th>
															</tr>
														</table>
													</div>
												</td>
											</tr>
											<tr>
												<td>
													<img src="images/lwxx_03.gif" />
												</td>
											</tr>
										</table>
									</td>
									<td width="30%" valign="bottom">
										<img src="images/computer02.gif" />
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</div>
		</form>
	</body>
</html>
